<style lang="scss" rel="stylesheet/scss">
    
</style>
<template>
    <div class="index-detail">
       <router-view></router-view>
    </div>
</template>

<script>
    export default {
        components: {
            
        },
        
        data () {
            return {
                fromType:'',
                detailId:'',
                unionid: ''
            }
        },
        mounted () {
            
        },
        created() {
            this.fetchData()
        },
        methods: {
            fetchData () {
                console.log(document)
                console.log(location)
                let fromUrl = document.referrer
                // let fromParam = location.search //?id=6939&f=1&unionid=oc6KSw1HM0AxFtzuftDs5c2YH0ZU
                let fromParam = location.href // http://localhost:8002/publish/beforeindex?f=unitary_advert&unionid=oc6KSw1HM0AxFtzuftDs5c2YH0ZU
                if(fromParam.indexOf('?') != -1) {
                    fromParam = fromParam.split('?')[1]
                    let from = fromParam.split('&')[0]
                    this.fromType = from.split('=')[1]
                    let unionid = fromParam.split('&')[1]
                    unionid = unionid.split('=')[1]
                    this.unionid = unionid.split('#')[0]
                    this.$router.replace({name:'publish-index',params:{fromType:this.fromType,unionid:this.unionid}})
                }
            }
        }
    }
</script>

